home *** CD-ROM | disk | FTP | other *** search
/ The American Nation / Resource Pro - The American Nation.iso / pc / data1.cab / Database_Files / ResourcePro.exe / launchpd.dxr / 00021_StartMovie Script.ls < prev    next >
Encoding:
Text File  |  2000-11-28  |  9.5 KB  |  311 lines

  1. on startMovie
  2.   global gCDDrive, gCurriculum, gMacMenu, gCDVolume, acro
  3.   set the exitLock to 1
  4.   set gCDDrive to EMPTY
  5.   set gCurriculum to "TANS"
  6.   set gCDVolume to "The American Nation:"
  7.   if the platform contains "macintosh" then
  8.     set gMacMenu to "off"
  9.   else
  10.     set gMacMenu to "nomenu"
  11.   end if
  12.   macMenuOn()
  13.   if the platform contains "macintosh" then
  14.     set acro to initMasterApp("5rhchurw2pt6")
  15.   end if
  16. end
  17.  
  18. on stopMovie
  19.   global acro
  20.   if the platform contains "macintosh" then
  21.     cleanUp(acro)
  22.   end if
  23. end
  24.  
  25. on DirectorTask
  26.   global acro
  27.   return DirectorTask(acro)
  28. end
  29.  
  30. on GetTaskOrder
  31.   global acro
  32.   return GetTaskOrder(acro)
  33. end
  34.  
  35. on FeedGenericTimeSlice
  36.   global acro
  37.   FeedGenericTimeSlice(acro)
  38. end
  39.  
  40. on macMenuOn
  41.   global gMacMenu
  42.   if gMacMenu = "off" then
  43.     installMenu(member "Menubar")
  44.     set gMacMenu to "on"
  45.   end if
  46. end
  47.  
  48. on macMenuOFF
  49.   global gMacMenu
  50.   if gMacMenu = "on" then
  51.     installMenu(0)
  52.     set gMacMenu to "off"
  53.   end if
  54. end
  55.  
  56. on checkMacMenuStatus
  57.   global gMacMenu
  58.   if gMacMenu = "off" then
  59.     macMenuOn()
  60.   end if
  61. end
  62.  
  63. on macMenuQuit
  64.   macMenuOFF()
  65.   go("exit")
  66. end
  67.  
  68. on openPDF fileName, mode
  69.   global gCDDrive, gCDVolume
  70.   if the platform contains "windows" then
  71.     case mode of
  72.       "CD":
  73.         if gCDDrive = EMPTY then
  74.           set myfile to new(xtra("fileio"))
  75.           repeat with i = 66 to 90
  76.             set drive to numToChar(i)
  77.             set thisPath to string(drive & ":\" & fileName)
  78.             openFile(myfile, thisPath, 1)
  79.             if status(myfile) = 0 then
  80.               set gCDDrive to drive
  81.               exit repeat
  82.             end if
  83.           end repeat
  84.           set myfile to 0
  85.         end if
  86.         set PDFname to gCDDrive & ":\" & fileName
  87.       "HD":
  88.         set tempdir to the pathName
  89.         repeat while the last char in tempdir <> "\"
  90.           delete char -30000 of tempdir
  91.         end repeat
  92.         set PDFname to tempdir & fileName
  93.       "AB":
  94.         set PDFname to fileName
  95.     end case
  96.     set iError to openFile(xtra("QILingo"), PDFname)
  97.     if iError <= 32 then
  98.       case iError of
  99.         0, 8:
  100.           return "Could not open the file, because there is not enough free memory. Close other open applications and try again."
  101.         2, 3:
  102.           if mode = "CD" then
  103.             return "Could not open the file, because it was not found. Make sure the Resource Pro CD-ROM is in your CD-ROM drive and try again."
  104.           else
  105.             return "Could not open the file, because it was not found. Make sure all components of Resource Pro have been installed correctly."
  106.           end if
  107.         31:
  108.           return "Acrobat Reader is required to view this document. The Acrobat Reader installer is located on the Resource Pro CD-ROM. Please install Acrobat Reader, then try again."
  109.         otherwise:
  110.           return "Could not open the file because an error occurred: " & iError
  111.       end case
  112.     else
  113.       return "none"
  114.     end if
  115.   else
  116.     case mode of
  117.       "CD":
  118.         set PDFname to gCDVolume & fileName
  119.       "HD":
  120.         set tempdir to the pathName
  121.         repeat while the last char in tempdir <> ":"
  122.           delete char -30000 of tempdir
  123.         end repeat
  124.         set PDFname to tempdir & fileName
  125.       "AB":
  126.         set PDFname to fileName
  127.     end case
  128.     set iError to launchAcroWithDoc(PDFname)
  129.     if iError < 0 then
  130.       case iError of
  131.         (-1):
  132.           if mode = "CD" then
  133.             return "Could not open the file, because it was not found. Make sure the Resource Pro CD-ROM is in your CD-ROM drive and try again."
  134.           else
  135.             return "Could not open the file, because it was not found. Make sure all components of Resource Pro have been installed correctly."
  136.           end if
  137.         (-35):
  138.           return "Acrobat Reader is required to view this document. The Acrobat Reader installer is located on the Resource Pro CD-ROM. Please install Acrobat Reader, then try again."
  139.         (-108):
  140.           return "Could not open the file, because there is not enough free memory. Close other open applications and try again."
  141.         otherwise:
  142.           return "Could not open the file because an error occurred: " & iError
  143.       end case
  144.     else
  145.       return "none"
  146.     end if
  147.   end if
  148. end
  149.  
  150. on OpenApp fileName, mode, cmdLine
  151.   global gCDDrive, gCDVolume
  152.   if the platform contains "windows" then
  153.     case mode of
  154.       "CD":
  155.         if gCDDrive = EMPTY then
  156.           set myfile to new(xtra("fileio"))
  157.           repeat with i = 66 to 90
  158.             set drive to numToChar(i)
  159.             set thisPath to string(drive & ":\" & fileName)
  160.             openFile(myfile, thisPath, 1)
  161.             if status(myfile) = 0 then
  162.               set gCDDrive to drive
  163.               exit repeat
  164.             end if
  165.           end repeat
  166.           set myfile to 0
  167.         end if
  168.         set appname to gCDDrive & ":\" & fileName
  169.         set appdir to gCDDrive & ":\"
  170.       "HD":
  171.         set tempdir to the pathName
  172.         repeat while the last char in tempdir <> "\"
  173.           delete char -30000 of tempdir
  174.         end repeat
  175.         set appname to tempdir & fileName
  176.         set appdir to tempdir
  177.       "AB":
  178.         set appname to fileName
  179.         set appdir to appname
  180.         repeat while the last char in appdir <> "\"
  181.           delete char -30000 of appdir
  182.         end repeat
  183.     end case
  184.     if cmdLine <> VOID then
  185.       set iError to ShellExecute(xtra("QILingo"), "open", appname, cmdLine, appdir, 1)
  186.     else
  187.       set iError to openFile(xtra("QILingo"), appname)
  188.     end if
  189.     if iError <= 32 then
  190.       case iError of
  191.         0, 8:
  192.           return "Could not open the application, because there is not enough free memory. Close other open applications and try again."
  193.         2, 3:
  194.           if mode = "CD" then
  195.             return "Could not open the application, because it was not found. Make sure the Resource Pro CD-ROM is in your CD-ROM drive and try again."
  196.           else
  197.             return "Could not open the application, because it was not found. Make sure all components of Resource Pro have been installed correctly."
  198.           end if
  199.         otherwise:
  200.           return "Could not open the application because an error occurred: " & iError
  201.       end case
  202.     else
  203.       return "none"
  204.     end if
  205.   else
  206.     case mode of
  207.       "CD":
  208.         set appname to gCDVolume & fileName
  209.       "HD":
  210.         set tempdir to the pathName
  211.         repeat while the last char in tempdir <> ":"
  212.           delete char -30000 of tempdir
  213.         end repeat
  214.         set appname to tempdir & fileName
  215.       "AB":
  216.         set appname to fileName
  217.     end case
  218.     if cmdLine <> VOID then
  219.       set iError to launchApp(appname, cmdLine)
  220.     else
  221.       set iError to launchApp(appname)
  222.     end if
  223.     if iError < 0 then
  224.       case iError of
  225.         (-1):
  226.           if mode = "CD" then
  227.             return "Could not open the application, because it was not found. Make sure the Resource Pro CD-ROM is in your CD-ROM drive and try again."
  228.           else
  229.             return "Could not open the application, because it was not found. Make sure all components of Resource Pro have been installed correctly."
  230.           end if
  231.         (-108):
  232.           return "Could not open the application, because there is not enough free memory. Close other open applications and try again."
  233.         otherwise:
  234.           return "Could not open the application because an error occurred: " & iError
  235.       end case
  236.     else
  237.       return "none"
  238.     end if
  239.   end if
  240. end
  241.  
  242. on OpenDIR fileName, mode
  243.   global gCDVolume
  244.   set dirName to EMPTY
  245.   if the platform contains "windows" then
  246.     case mode of
  247.       "CD":
  248.         set myfile to new(xtra("fileio"))
  249.         repeat with i = 66 to 90
  250.           set drive to numToChar(i)
  251.           set thisPath to string(drive & ":\" & fileName)
  252.           openFile(myfile, thisPath, 1)
  253.           if status(myfile) = 0 then
  254.             set dirName to drive & ":\" & fileName
  255.             closeFile(myfile)
  256.             exit repeat
  257.           end if
  258.         end repeat
  259.         set myfile to 0
  260.       "HD":
  261.         set tempdir to the pathName
  262.         repeat while the last char in tempdir <> "\"
  263.           delete char -30000 of tempdir
  264.         end repeat
  265.         set dirName to tempdir & fileName
  266.       "AB":
  267.         set dirName to fileName
  268.     end case
  269.     if dirName = EMPTY then
  270.       if mode = "CD" then
  271.         return "Could not open the file, because it was not found. Make sure the Resource Pro CD-ROM is in your CD-ROM drive and try again."
  272.       else
  273.         return "Could not open the file, because it was not found. Make sure all components of Resource Pro have been installed correctly."
  274.       end if
  275.     end if
  276.     go(1, dirName)
  277.     return "none"
  278.   else
  279.     set err to "none"
  280.     case mode of
  281.       "CD":
  282.         set dirName to gCDVolume & fileName
  283.         set myfile to new(xtra("fileio"))
  284.         openFile(myfile, dirName, 1)
  285.         if status(myfile) <> 0 then
  286.           set err to "no cd"
  287.           closeFile(myfile)
  288.         end if
  289.         set myfile to 0
  290.       "HD":
  291.         set tempdir to the pathName
  292.         repeat while the last char in tempdir <> ":"
  293.           delete char -30000 of tempdir
  294.         end repeat
  295.         set dirName to tempdir & fileName
  296.       "AB":
  297.         set dirName to fileName
  298.     end case
  299.     if err <> "none" then
  300.       if mode = "CD" then
  301.         return "Could not open the file, because it was not found. Make sure the Resource Pro CD-ROM is in your CD-ROM drive and try again."
  302.       else
  303.         return "Could not open the file, because it was not found. Make sure all components of Resource Pro have been installed correctly."
  304.       end if
  305.     else
  306.       go(1, dirName)
  307.       return "none"
  308.     end if
  309.   end if
  310. end
  311.